﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="DocumentList.aspx.cs" Inherits="LizzabethBrownRealEstate.Views.Admin.DocumentList" %>
<%@ Import Namespace="LizzabethBrownRealEstate.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="StylePlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div class="conentDiv" style="margin-left:25%; margin-top:30px">
        <fieldset style="margin-bottom:20px; width:350px">
            <legend>Documents</legend>
            <% LBRDataContext dc = new LBRDataContext(); %>
            <table width="100%" style="border-collapse:collapse; margin-bottom:20px;">
            <% foreach (Document d in dc.Documents)
               {
                   if (d.Deleted) continue;%>
               <tr style="cursor:pointer" onmouseover="javascript:this.style.backgroundColor='Silver';" onmouseout="javascript:this.style.backgroundColor='Transparent'">
                    <td><a href= '<%= "../Repository/" + d.FileName %>' class="resourceListButton" target="_blank" ><%= Html.Encode(d.Title) %></a></td>
                    <td><a href='<%= Url.Action("EditDocument", new { Controller = "Admin", documentId = d.DocumentId })%>' class="linktableButton">Edit</a></td>
                    <td><a onclick="javascript:return confirm('Delete this document?')" href='<%= Url.Action("DeleteDocument", new { Controller = "Admin", documentId = d.DocumentId })%>' class="linktableButton">Delete</a></td>
               </tr>
            <%} %>
            </table>
        </fieldset>
    </div>
</asp:Content>
